package com.ucode.model.hrm.form;

import com.ucode.model.hrm.enums.*;
import com.ucode.tool.base.enums.EducationLevelEnum;
import com.ucode.tool.validator.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 招聘岗位
 * @Author: Administrator
 * @Date: 2025/5/21 15:47
 * @Version: 1.0
 */
@Schema(description = "人力资源管理系统 - 招聘岗位Form")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class HrmJobPostForm{

    /**
     * 关联客户项目
     */
    @Schema(description = "关联客户项目", requiredMode = Schema.RequiredMode.AUTO)
    private Long projectId;
    /**
     * 标题
     */
    @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "标题不能为空")
    @Size(max = 100, message = "标题不能超过 100 个字符")
    private String title;
    /**
     * 公司名称
     */
    @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "公司名称不能为空")
    @Size(max = 100, message = "公司名称不能超过 100 个字符")
    private String companyName;

    // 薪资信息
    /**
     * 薪资类型
     * @see HrmSalaryTypeEnum
     */
    @Schema(description = "薪资类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "薪资类型不能为空")
    @InEnum(value= HrmSalaryTypeEnum.class)
    private Integer salaryType;
    /**
     * 薪资范围-最低薪资
     */
    @Schema(description = "最低薪资", requiredMode = Schema.RequiredMode.REQUIRED)
    @Min(value = 0, message = "最低薪资不能小于 0")
    private Integer salaryMin;
    /**
     * 薪资范围-最高薪资
     */
    @Schema(description = "最高薪资", requiredMode = Schema.RequiredMode.REQUIRED)
    @Min(value = 0, message = "最高薪资不能小于 0")
    private Integer salaryMax;
    /**
     * 薪资计费单位
     * @see com.ucode.model.hrm.enums.HrmSalaryUnitEnum
     */
    @Schema(description = "薪资计费单位", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "薪资计费单位不能为空")
    @InEnum(value= HrmSalaryUnitEnum.class)
    private Integer salaryUnit;

    // 工作地点
    /**
     * 省份
     */
    @Schema(description = "所在省份", example = "1", requiredMode = Schema.RequiredMode.AUTO)
    private  Long province;
    /**
     * 城市
     */
    @Schema(description = "所在城市", example = "1", requiredMode = Schema.RequiredMode.AUTO)
    private Long city;
    /**
     * 地区
     */
    @Schema(description = "所在地区", example = "1", requiredMode = Schema.RequiredMode.AUTO)
    private Long area;
    /**
     * 工作城市,多个城市用逗号分隔
     */
    @Schema(description = "工作城市", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "工作城市不能为空")
    @Size(max = 255, message = "工作城市不能超过 255 个字符")
    private String workAddress;
    /**
     * 是否远程
     */
    @Schema(description = "是否远程", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否远程不能为空")
    private Boolean isRemote;
    /**
     * 经验要求
     */
    @Schema(description = "经验要求", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "经验要求不能为空")
    @Size(max = 50, message = "经验要求不能超过 50 个字符")
    private String experience;
    /**
     * 学历要求
     * @see HrmEmploymentTypeEnum
     */
    @Schema(description = "学历要求", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "学历要求不能为空")
    @InEnum(value= EducationLevelEnum.class)
    private Integer education;
    /**
     * 职位类型
     * @see com.ucode.model.hrm.enums.HrmJobTypeEnum
     */
    @Schema(description = "职位类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "职位类型不能为空")
    @InEnum(value= HrmJobTypeEnum.class)
    private Integer jobType;

    // 详细信息
    @Schema(description = "详细信息", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "详细信息不能为空")
    private String description;

    @Schema(description = "职位状态", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "职位状态不能为空")
    @InEnum(value= HrmJobStatusEnum.class)
    private Integer status;
}
